<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jstl/core"
  template="/WEB-INF/layouts/templateAdmin.xhtml">


  <ui:define name="menu">
    <!-- INCLUDE MENU -->
  </ui:define>

  <ui:define name="content">

    <c:if test="${flowScope.val == true}">
      <c:set var="title" scope="view" value="More informations" />
    </c:if>
    <c:if test="${flowScope.val == false}">
      <c:set var="title" scope="view" value="Modify account" />
    </c:if>

    <!-- INCLUDE CONTENT -->
    <h1 class="pageTitle">#{title}</h1>

    <h:form id="showAccount">
      <h:panelGrid columns="2">
        <h:outputText class="inlineText" value="Firstname* : " />
        <h:panelGroup>
          <h:inputText value="#{flowScope.personSelected.firstName}"
            id="firstname" required="true" disabled="#{val}" />
          <h:message for="firstname" />
        </h:panelGroup>

        <h:outputText value="Lastname* :" />
        <h:panelGroup>
          <h:inputText value="#{flowScope.personSelected.lastName}"
            id="lastname" required="true" disabled="#{val}" />
          <h:message for="lastname" />
        </h:panelGroup>

        <h:outputText value="Group :" />
        <h:panelGroup>
          <h:selectOneMenu value="#{personSelected.group}" id="group"
            disabled="#{val}">
            <f:selectItem itemValue="admin" itemLabel="admin" />
            <f:selectItem itemValue="user" itemLabel="user" />
            <f:selectItem itemValue="buyer" itemLabel="buyer" />
          </h:selectOneMenu>
          <h:message for="group" />
        </h:panelGroup>

        <h:outputText value="Email :" />
        <h:panelGroup>
          <h:inputText value="#{flowScope.personSelected.user_id}"
            id="userid" required="false" disabled="#{val}" />
          <h:message for="userid" />
        </h:panelGroup>

        <h:outputText class="inlineText" value="Phone Number :" />
        <h:panelGroup>
          <h:inputText
            value="#{flowScope.personSelected.telephoneNumber}"
            id="telephoneNumber" required="false" disabled="#{val}" />
          <h:message for="telephoneNumber" />
        </h:panelGroup>

        <h:outputText value="Cell Number :" />
        <h:panelGroup>
          <h:inputText value="#{flowScope.personSelected.mobile}"
            id="cellNumber" required="false" disabled="#{val}" />
          <h:message for="cellNumber" />
        </h:panelGroup>

        <h:outputText value="Address :" />
        <h:panelGroup>
          <h:inputText value="#{flowScope.personSelected.postalAddress}"
            id="address" required="false" disabled="#{val}" />
          <h:message for="address" />
        </h:panelGroup>

        <h:outputText value="Postal Code :" />
        <h:panelGroup>
          <h:inputText value="#{flowScope.personSelected.postalCode}"
            id="postalCode" required="false" disabled="#{val}" />
          <h:message for="postalCode" />
        </h:panelGroup>

        <h:outputText value="City :" />
        <h:panelGroup>
          <h:inputText value="#{flowScope.personSelected.city}"
            id="city" required="false" disabled="#{val}" />
          <h:message for="city" />
        </h:panelGroup>

        <h:outputText value="Description* :" />
        <h:panelGroup>
          <h:inputTextarea
            value="#{flowScope.personSelected.description}"
            id="description" required="true" rows="4" cols="40"
            disabled="#{val}" />
          <h:message for="description" />
        </h:panelGroup>

      </h:panelGrid>

      <br />


      <h:commandButton value="Modify Account" action="modify"
        type="submit" />

      <c:if test="${flowScope.val == true}">
        <h:commandButton value="Delete Account" action="delete"
          type="submit" />
      </c:if>
    </h:form>

    <br />

    <h:form>
      <h:commandLink action="back">
        Back
      </h:commandLink>
    </h:form>
  </ui:define>
</ui:composition>
